package mashibing.class5;

import util.MathUtil;

import java.util.Arrays;

/**
 * @author yujiafan
 * @version 1.0.0
 * @create 2023-03-23
 */
public class Class5_Test {

    public static void main(String[] args) {
        int testCount = 50000;
        boolean flag = true;
        System.out.println("begin");
        for (int i = 0; i < testCount; i++) {
            int[] arr = MathUtil.generateArray(100,100);
            int[] arr1 = MathUtil.copyArray(arr);
            int[] arr2 = MathUtil.copyArray(arr);
            Arrays.sort(arr1);
            Class5_3_QuickSorted.quickSorted(arr2);
            if (!MathUtil.isEqualArray(arr1, arr2)) {
                flag = false;
                System.out.println("error!");
                System.out.println(Arrays.toString(arr));
                break;
            }
        }
        if (flag) {
            System.out.println("success!");
        }
    }
}
